import java.util.Scanner;
class WithdrawMoney{
    public static void main(String[] args){

        Scanner scan = new Scanner(System.in);

        double money =0;

        while (true){
            System.out.println("========ATM========");
            System.out.println("1.存款");
            System.out.println("2.取款");
            System.out.println("3.显示余额");
            System.out.println("4.退出");
            System.out.println("请选择(1-4):");


            int month = scan.nextInt();

            System.out.println("您的选择是=========>>:"+month);

            if (month==1){
                System.out.println("请输入存款金额:");
                double a = scan.nextDouble();
                money = money + a;

            }else if (month==2){
                System.out.println("请输入取款金额:");
                double b = scan.nextDouble();

                if (b>money){
                    System.out.println("当前余额为:" + money+"====>>余额不足");
                }else if (b<0){
                    System.out.println("取款金额错误");
                }else{
                    money = money - b;
                }


            }else if (month==3){
                System.out.println("您的当前余额为:" + money);
                double c = scan.nextDouble();


            }else if(month==4){
                break;
            }

        }





    }
}
